-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix empty pk detection in HyperlinkRelatedField.get_url #3962
Fix empty pk detection in HyperlinkRelatedField.get_url #3962
Conversation
@jslang lgtm, thanks! |
@@ -87,6 +87,19 @@ def test_pk_representation(self): | |||
assert representation == self.instance.pk.int | |||
|
|||
|
|||
class TestHyperlinkedRelatedField(APISimpleTestCase): | |||
def setUp(self): | |||
self.instance = MockObject(pk=1, name='foo') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get rid of this self.instance
which is not used in this test case.
125334d
to
186c0e3
Compare
This implementation allows detection of empty values that are non-nullable, allowing the field to return None values for such cases
186c0e3
to
7ac8cc7
Compare
Looks good to me too. |
Fix empty pk detection in HyperlinkRelatedField.get_url
Thanks! |
This implementation allows detection of empty values that are non-nullable, allowing the field to return
None
values for such cases. Fixes #3959